<template>
    <div>
        <div>
            <el-form :inline="true" label-width="100" :model="formInline"  class="demo-form-inline">
                <el-form-item label="回库类型">
                    <el-select class="input-width" v-model="formInline.storevalue" size="mini" placeholder="回库类型">
                        <el-option v-for="store in storeTypes" :key="store.value" :label="store.label" :value="store.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="任务状态">
                    <el-select class="input-width" v-model="formInline.taskvalue" size="mini" placeholder="任务状态">
                        <el-option v-for="task in taskoptions" :key="task.value" :label="task.label" :value="task.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="巷道">
                    <el-select class="input-width" v-model="formInline.roadvalue" size="mini" placeholder="巷道">
                        <el-option v-for="road in roadoptions" :key="road.value" :label="road.label" :value="road.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="箱号/托盘号">
                    <el-input class="input-width" v-model="formInline.palletCode" size="mini" placeholder="箱号/托盘号"></el-input>
                </el-form-item>
                <el-form-item label="起始位置">
                    <el-input class="input-width" v-model="formInline.startCode" size="mini" placeholder="起始位置"></el-input>
                </el-form-item>
                <el-form-item label="结束位置">
                    <el-input class="input-width" v-model="formInline.endCode" size="mini" placeholder="结束位置"></el-input>
                </el-form-item>
                
                <el-form-item label="任务创建日期">
                    <el-date-picker style="width:140px" value-format="yyyy-MM-dd" v-model="formInline.startTime" size="mini" type="date" placeholder="开始日期"></el-date-picker>到
                    <el-date-picker style="width:140px" value-format="yyyy-MM-dd" v-model="formInline.endTime" size="mini" type="date" placeholder="结束日期"></el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" size="mini" @click="doQuery">查询</el-button>
                    <el-button type="primary" size="mini" @click="doReset">重置</el-button>
                </el-form-item>
            </el-form>
        </div>
        <div>
            <el-table ref="multipleTable" height="550" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="55"> </el-table-column>
                <el-table-column prop="wmsTaskId" label="任务ID" width="120"></el-table-column>
                <el-table-column prop="palletCode" label="托盘/箱子" width="120"></el-table-column>
                <el-table-column prop="startCode" label="开始位置" width="120"></el-table-column>
                <el-table-column prop="endCode" label="结束位置" width="120"></el-table-column>
                <el-table-column prop="taskType" label="任务类型" width="120"></el-table-column>
                <el-table-column prop="command" label="命令类型" width="120"></el-table-column>
                <el-table-column prop="isFinish" label="任务是否完成" width="120"></el-table-column>
                <el-table-column prop="roadway" label="所属巷道" ></el-table-column>
                <el-table-column prop="isBack" label="是否回库" ></el-table-column>
                <el-table-column prop="result" label="叫箱类型" width="150"></el-table-column>
                <el-table-column prop="taskCnt" label="任务数量" width="150"></el-table-column>
                <el-table-column prop="createTime" label="任务创建日期" width="150"></el-table-column>
                <el-table-column prop="orderTime" label="任务下发wcs日期" width="150"></el-table-column>
                <el-table-column prop="orderStartTime" label="任务开始执行日期" width="150"></el-table-column>
                <el-table-column prop="orderEndTime" label="任务结束日期" width="150"></el-table-column>
                <el-table-column prop="msGkLogId" label="姓主键名" width="350"></el-table-column>
            </el-table>
            <div>
                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.currentPage"
                :page-sizes="[50,100, 200, 300, 400]" :page-size="page.pageSize"  layout="total, sizes, prev, pager, next" :total="page.total">
                </el-pagination>
            </div>
        </div>

    </div>
</template>

<script>
import request from "@/utils/request.js";
export default{
    name:"wmsLogQuery",
    data(){
        return {
            formInline:{
                palletCode:"",
                taskvalue:"",
                roadvalue:"",
                storevalue:"",
                startCode:"",
                endCode:"",
                startTime:"",
                endTime:""
            },
            taskoptions:[{
                label:"请选择",
                value:"0"
            },{
                label:"已完成",
                value:"Y"
            },{
                label:"未完成",
                value:"N"
            }],
            storeTypes:[{
                label:"请选择",
                value:"0"
            },{
                label:"移库",
                value:"3"
            },{
                label:"入库",
                value:"1"
            },{
                label:"出库",
                value:"2"
            }],
            roadoptions:[{
                label:"请选择",
                value:"0"
            },{
                label:"巷道1",
                value:"road1"
            },{
                label:"巷道2",
                value:"road2"
            },{
                label:"巷道3",
                value:"road3"
            },{
                label:"巷道4",
                value:"road4"
            },{
                label:"巷道5",
                value:"road5"
            },{
                label:"巷道6",
                value:"road6"
            }],
            page:{
                total:1,
                pageSize:50,
                currentPage:1
            },
            tableData:[]
        }
    },
    methods:{
        handleSelectionChange(){

        },
        handleSizeChange(val){
            this.page.pageSize = val;
        },
        handleCurrentChange(val){
            this.page.currentPage = val;
            this.$options.methods.doQuery.bind(this)();
        },
        //查询
        doQuery(){
            var that = this;
            request.post("/synthesizeQueryRest/queryGkLog",{"page":this.page,"queryParam":this.formInline}).then((res)=>{
                console.log(res);
                that.tableData = res.data.list;
                that.page.total = res.data.total;
            });
        },
        //重置
        doReset(){
            Object.assign(this.formInline,this.$options.data().formInline);
        }
    }
}
</script>